<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAkbusAccidentSocietyTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('akbus_accident_society', function (Blueprint $table) {
            $table->id();
            $table->string('number')->nullable()->comment('单号');
            $table->string('case_number')->nullable()->comment('案号');
            // 司机部分
            $table->date('date')->nullable()->comment('事故日期');
            $table->string('license_plate_num')->nullable()->comment('车辆车牌号');
            $table->integer('user_id')->nullable()->comment('驾驶员，保存驾驶员的用户id');
            $table->string('user_name')->nullable()->comment('驾驶员，保存驾驶员名字');
            $table->string('accident_info', 500)->nullable()->comment('事故详情');
            // 事故处理部-事故处理
            $table->string('receiver_id')->nullable()->comment('接案人');
            $table->string('responsible')->nullable()->comment('事故责任认定');
            // 事故处理部-事故费用
            $table->decimal('loss_cost', 10, 2)->nullable()->comment('赔付金额');
            $table->text('remark')->nullable()->comment('备注');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('akbus_accident_society');
    }
}
